package com.by.config;

import feign.Logger;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.support.BasicAuthenticationInterceptor;

/**
 * @version 1.0
 * @Author 彭彦彬
 * @Date 2025/4/2 14:24
 * @注释
 */
@Configuration
public class FeignConfig {
    /**
     * 设置日志级别
     *
     * @return
     */
    @Bean
    public Logger.Level level() {
        return Logger.Level.FULL;
    }

    /**
     * 基础授权 请求拦截 通过feign调用远程接口，拦截请i去，自动加上 认真信息:应户名密码
     *
     * @return
     */
    @Bean
    public BasicAuthRequestInterceptor requestInterceptor(){
        return new BasicAuthRequestInterceptor("admin","123456");
    }
}
